#include "game.hpp"

const ID DUMMY_MAKER_ID = 1;

Game::Game(ID gameId,ID makerId, int rate):
	gameId(gameId), 
	makerId(makerId),
	rate(rate)
	{}

ID Game::getId() const {return gameId;}
bool Game::isMadeBy(ID companyId) const{return companyId == makerId;}

/* Operators */	                 
bool Game::operator<(const Game& otherGame) const {
	return ((rate < otherGame.rate) || 
				((rate == otherGame.rate) && (gameId < otherGame.gameId)));
}
bool Game::operator==(const Game& otherGame) const {
	return (rate == otherGame.rate) && (gameId == otherGame.gameId);
}
bool Game::operator!=(const Game& otherGame) const {return !(*this == otherGame);}

Game getGameForComparison(ID id, int rate) {
	return Game(id, DUMMY_MAKER_ID, rate);
}